package com.example.android.story.Utils;

import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import java.util.List;

/**
 * Created by liwei on 2018/5/21.
 */
@Dao
public interface PurchasedDao {
    @Insert
    public void insert(Purchased purchased);

    @Query("select * from _purchased where username=:user_name")
    public LiveData<List<Purchased>> getPurchasedLiveData(String user_name);


    @Query("select * from _purchased where username=:user_name")
    public List<Purchased> getPurchased(String user_name);

    @Update
    public void updatePurchased(Purchased purchased);

    @Delete
    public void deletePurchased(Purchased purchased);
}
